package com.xbongbong.pro.enums;

import com.xbongbong.saas.enums.XbbRefTypeEnum;
import lombok.Getter;

import java.util.Objects;

/**
 * @Author mingliang
 * @Description 精线索套餐
 * @Date 2021/10/26 19:23
 **/
@Getter
public enum FineClueToCustomerEnum {
    /**
     * 客户
     */
    CUSTOMER(1, XbbRefTypeEnum.CUSTOMER_MANAGEMENT.getCode()),
    /**
     * 线索
     */
    CLUE(2, XbbRefTypeEnum.CLUE.getCode()),

    ;

    private Integer type;
    private Integer code;


    FineClueToCustomerEnum(Integer type, Integer code) {
        this.type = type;
        this.code = code;
    }

    public static FineClueToCustomerEnum getByType(Integer type) {
        for (FineClueToCustomerEnum temp : values()) {
            if (Objects.equals(temp.getType(), type)) {
                return temp;
            }
        }
        return CUSTOMER;
    }

}
